/**
 * 项目名称:
 *
 * @Author: 夏国倩
 * @Date: 2023/10/12 10:48
 * @Copyright
 */
package multithreading;

//面试题
public class ThreadTest7 {
    public static void main(String[] args) throws InterruptedException {
        //创建线程
        Thread t=new Processor7();
        //给线程起名字
        t.setName("t");
        //启动线程
        t.start();
        //休眠
        t.sleep(5000); //等同于Thread.sleep(5000)阻塞还是当前线程，和t线程无关
        System.out.println("hello world");
        A a=null;
        a.m1(); //不会报空指针异常，空指针对象是指：空指针指向对象，m1为静态方法，不是对象
    }
}
class Processor7 extends Thread{
    public void run(){
        for (int i = 0; i < 200; i++) {
            System.out.println(Thread.currentThread().getName()+"----->"+i);
        }
    }
}
class A{
    public static void m1(){

    }
}